<template>

<h2>等级权益添加</h2>


<table class="table table-bordered">
<tr>
    <th>会员等级名称</th>
    <th>
        <input type="text" v-model="info.Rank_Name" >
    </th>
</tr>

<tr>
    <th>会员等级状态</th>
    <th> <input type="radio"  value="true" v-model="info.Rank_State">启用
        <input type="radio"  value="false" v-model="info.Rank_State">禁用
    </th>
</tr>


<tr>
    <th>最大成长值</th>
    <th>
        <input type="text"  v-model="info.Rank_MaxPoint">
    </th>
</tr>


<tr>
    <th>最小成长值</th>
    <th>
        <input type="text" v-model="info.Rank_MinPoint">
    </th>
</tr>

<tr>
    <th></th>
    <th>
        <input type="button" value="添加会员等级" @click="AddRank" class="btn btn-success">
    </th>
</tr>

</table>


</template>

<script setup lang="ts">

    import {ref} from 'vue'


    import axios from 'axios';

    const info =ref({
    Rank_Id: 0,
  Rank_Name:"",
  Rank_State: true,
  Rank_MaxPoint: 0,
  Rank_MinPoint: 0

    })



        const AddRank =()=>{

                axios .post('https://localhost:7035/api/Rank/AddRank',info.value)

                .then(res=>{

                        if(res.data>0){

                            alert('添加成功')
                        }
                        else 
                        {
                            alert('添加失败')
                        }

                })

                .catch(x=>{

                    console.log(x);
                })


        }





</script>